//调用接口配置文件
import { request,verifyCommissionToken } from 'config/request'
import config from '../../../config/config'

//获取分销公司名称
export async function queryAgent (params) {
  return request({
    // url: `${config.hktServer1}admin/commissionRule/queryAgent`,
    url: `admin/commissionRule/queryAgent`,
    method: 'POST',
    data: params,
    headers: {
      'Content-type': 'application/json',
    }
  })
  
}
//录入保存
export async function create (params) {
  return request({
    // url: `admin/commissionRule/insert`,
    url: `${config.mideaCommission}commission/wxyxTowcomruleH/add`,
    method: 'POST',
    data: params,
    headers: {
      'Content-type': 'application/json',
    }
  })
}

//录入保存
export async function edit (params) {
    return request({
      // url: `admin/commissionRule/insert`,
      url: `${config.mideaCommission}commission/wxyxTowcomruleH/edit`,
      method: 'PUT',
      data: params,
      headers: {
        'Content-type': 'application/json',
      }
    })
  }


//编辑查看时获取数据
export async function queryInfo (params) {
  return request({
    // url: `admin/commissionRule/listDetail`,
    url: `${config.mideaCommission}commission/wxyxTowcomruleH/queryById`,
    method: 'GET',
    data: params,
    headers: {
      'Content-type': 'application/json',
    }
  })
}
export async function queryRuleInfo (params) {
    return request({
      // url: `admin/commissionRule/listDetail`,
      url: `${config.mideaCommission}commission/wxyxTowcomruleH/queryWxyxTowcomruleBByMainId`,
      method: 'GET',
      data: params,
      headers: {
        'Content-type': 'application/json',
      }
    })
  }
//项目名称过滤
export async function projectFilter(params) {
  return request({
    url: `${config.mideaCommission}commission/wxyxCommissionH/selectProject`,
      method: 'GET',
      data: params,
  });
};
// 获取项目列表
export async function selectProject(params) {
    return request({
        url: `${config.mideaCommission}commission/wxyxCommissionH/selectProject`,
        method: 'GET',
        headers: {
            "Content-type": "application/json"
        },
        data: params
    });
  };

//获取业态
export async function queryProductList(params) {
  return request({
    url: `${config.mideaCommission}commission/wxyxCommissionH/selectHxsProductType`,
      method: 'GET',
      data: params,
  });
};

export async function verifyCommissionTokenFun(){
  return verifyCommissionToken();
}


